package com.ym.medical.dao;

import com.ym.medical.domain.entity.CouponEntity;
import com.ym.medical.domain.param.CouponParam;
import com.ym.medical.domain.vo.CouponVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 优惠劵Dao接口
 *
 * @author ym
 * @date 2020-09-15
 */
@Repository
public interface CouponDao extends Mapper<CouponEntity>{

    /**
     * 优惠券列表
     * @param couponModel
     * @return
     */
    List<CouponVo> couponList(CouponParam couponModel);

    /**
     * 我的优惠券
     * @param couponModel
     * @return
     */
    List<CouponVo> myCoupon(CouponParam couponModel);

    /**
     * 随访优惠券列表
     * @param arrs
     * @param sendId
     * @param receiverId
     * @return
     */
    List<CouponVo> coupons(
            @Param("arrs") String arrs,
            @Param("sendId") Long sendId,
            @Param("receiverId") int receiverId);

    /**
     * 根据优惠劵领取记录主键查询优惠劵
     * @param receiveId
     * @return
     */
    CouponEntity selectByReciveId(@Param("receiveId") Long receiveId);

}
